﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using DBUtility;//请先添加引用
namespace TierApplication
{
    /// <summary>
    /// 类T_Product。
    /// </summary>
    [Serializable]
    public partial class T_Product
    {
        public T_Product()
        { }
        #region Model
        private string _productid;
        private string _productno;
        private string _productname;
        private string _productnameen;
        private string _producttype;
        private string _supplierid;
        private string _spec1;
        private string _spec2;
        private string _spec3;
        private string _unit;
        private decimal? _unitprice;
        private decimal? _unitpriceout;
        private decimal? _depotup;
        private decimal? _depotdown;
        private string _color;
        private string _size;
        private string _remark;
        private decimal? _point;
        private string _productprop;
        private DateTime? _createdate;
        private string _createuser;
        private string _photo;
        private decimal? _curqty;
        private string _usefullifetype;
        private string _baseproductplace;
        /// <summary>
        /// 
        /// </summary>
        public string ProductID
        {
            set { _productid = value; }
            get { return _productid; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string ProductNo
        {
            set { _productno = value; }
            get { return _productno; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string ProductName
        {
            set { _productname = value; }
            get { return _productname; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string ProductNameEn
        {
            set { _productnameen = value; }
            get { return _productnameen; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string ProductType
        {
            set { _producttype = value; }
            get { return _producttype; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string SupplierID
        {
            set { _supplierid = value; }
            get { return _supplierid; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Spec1
        {
            set { _spec1 = value; }
            get { return _spec1; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Spec2
        {
            set { _spec2 = value; }
            get { return _spec2; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Spec3
        {
            set { _spec3 = value; }
            get { return _spec3; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Unit
        {
            set { _unit = value; }
            get { return _unit; }
        }
        /// <summary>
        /// 
        /// </summary>
        public decimal? UnitPrice
        {
            set { _unitprice = value; }
            get { return _unitprice; }
        }
        /// <summary>
        /// 
        /// </summary>
        public decimal? UnitPriceOut
        {
            set { _unitpriceout = value; }
            get { return _unitpriceout; }
        }
        /// <summary>
        /// 
        /// </summary>
        public decimal? DepotUp
        {
            set { _depotup = value; }
            get { return _depotup; }
        }
        /// <summary>
        /// 
        /// </summary>
        public decimal? DepotDown
        {
            set { _depotdown = value; }
            get { return _depotdown; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Color
        {
            set { _color = value; }
            get { return _color; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Size
        {
            set { _size = value; }
            get { return _size; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Remark
        {
            set { _remark = value; }
            get { return _remark; }
        }
        /// <summary>
        /// 
        /// </summary>
        public decimal? Point
        {
            set { _point = value; }
            get { return _point; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string ProductProp
        {
            set { _productprop = value; }
            get { return _productprop; }
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime? CreateDate
        {
            set { _createdate = value; }
            get { return _createdate; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string CreateUser
        {
            set { _createuser = value; }
            get { return _createuser; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Photo
        {
            set { _photo = value; }
            get { return _photo; }
        }
        /// <summary>
        /// 
        /// </summary>
        public decimal? CurQty
        {
            set { _curqty = value; }
            get { return _curqty; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string UsefulLifeType
        {
            set { _usefullifetype = value; }
            get { return _usefullifetype; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string BaseProductPlace
        {
            set { _baseproductplace = value; }
            get { return _baseproductplace; }
        }
        #endregion Model


        #region  Method

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public T_Product(string ProductID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ProductID,ProductNo,ProductName,ProductNameEn,ProductType,SupplierID,Spec1,Spec2,Spec3,Unit,UnitPrice,UnitPriceOut,DepotUp,DepotDown,Color,Size,Remark,Point,ProductProp,CreateDate,CreateUser,Photo,CurQty,UsefulLifeType,BaseProductPlace ");
            strSql.Append(" FROM [T_Product] ");
            strSql.Append(" where ProductID=@ProductID ");
            SqlParameter[] parameters = {
					new SqlParameter("@ProductID", SqlDbType.VarChar,-1)};
            parameters[0].Value = ProductID;

            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["ProductID"] != null)
                {
                    this.ProductID = ds.Tables[0].Rows[0]["ProductID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ProductNo"] != null)
                {
                    this.ProductNo = ds.Tables[0].Rows[0]["ProductNo"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ProductName"] != null)
                {
                    this.ProductName = ds.Tables[0].Rows[0]["ProductName"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ProductNameEn"] != null)
                {
                    this.ProductNameEn = ds.Tables[0].Rows[0]["ProductNameEn"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ProductType"] != null)
                {
                    this.ProductType = ds.Tables[0].Rows[0]["ProductType"].ToString();
                }
                if (ds.Tables[0].Rows[0]["SupplierID"] != null)
                {
                    this.SupplierID = ds.Tables[0].Rows[0]["SupplierID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Spec1"] != null)
                {
                    this.Spec1 = ds.Tables[0].Rows[0]["Spec1"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Spec2"] != null)
                {
                    this.Spec2 = ds.Tables[0].Rows[0]["Spec2"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Spec3"] != null)
                {
                    this.Spec3 = ds.Tables[0].Rows[0]["Spec3"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Unit"] != null)
                {
                    this.Unit = ds.Tables[0].Rows[0]["Unit"].ToString();
                }
                if (ds.Tables[0].Rows[0]["UnitPrice"] != null && ds.Tables[0].Rows[0]["UnitPrice"].ToString() != "")
                {
                    this.UnitPrice = decimal.Parse(ds.Tables[0].Rows[0]["UnitPrice"].ToString());
                }
                if (ds.Tables[0].Rows[0]["UnitPriceOut"] != null && ds.Tables[0].Rows[0]["UnitPriceOut"].ToString() != "")
                {
                    this.UnitPriceOut = decimal.Parse(ds.Tables[0].Rows[0]["UnitPriceOut"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DepotUp"] != null && ds.Tables[0].Rows[0]["DepotUp"].ToString() != "")
                {
                    this.DepotUp = decimal.Parse(ds.Tables[0].Rows[0]["DepotUp"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DepotDown"] != null && ds.Tables[0].Rows[0]["DepotDown"].ToString() != "")
                {
                    this.DepotDown = decimal.Parse(ds.Tables[0].Rows[0]["DepotDown"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Color"] != null)
                {
                    this.Color = ds.Tables[0].Rows[0]["Color"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Size"] != null)
                {
                    this.Size = ds.Tables[0].Rows[0]["Size"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Remark"] != null)
                {
                    this.Remark = ds.Tables[0].Rows[0]["Remark"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Point"] != null && ds.Tables[0].Rows[0]["Point"].ToString() != "")
                {
                    this.Point = decimal.Parse(ds.Tables[0].Rows[0]["Point"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ProductProp"] != null)
                {
                    this.ProductProp = ds.Tables[0].Rows[0]["ProductProp"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CreateDate"] != null && ds.Tables[0].Rows[0]["CreateDate"].ToString() != "")
                {
                    this.CreateDate = DateTime.Parse(ds.Tables[0].Rows[0]["CreateDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CreateUser"] != null)
                {
                    this.CreateUser = ds.Tables[0].Rows[0]["CreateUser"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Photo"] != null)
                {
                    this.Photo = ds.Tables[0].Rows[0]["Photo"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CurQty"] != null && ds.Tables[0].Rows[0]["CurQty"].ToString() != "")
                {
                    this.CurQty = decimal.Parse(ds.Tables[0].Rows[0]["CurQty"].ToString());
                }
                if (ds.Tables[0].Rows[0]["UsefulLifeType"] != null)
                {
                    this.UsefulLifeType = ds.Tables[0].Rows[0]["UsefulLifeType"].ToString();
                }
                if (ds.Tables[0].Rows[0]["BaseProductPlace"] != null)
                {
                    this.BaseProductPlace = ds.Tables[0].Rows[0]["BaseProductPlace"].ToString();
                }
            }
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string ProductID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from [T_Product]");
            strSql.Append(" where ProductID=@ProductID ");

            SqlParameter[] parameters = {
					new SqlParameter("@ProductID", SqlDbType.VarChar,-1)};
            parameters[0].Value = ProductID;

            return DbHelperSQL.Exists(strSql.ToString(), parameters);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into [T_Product] (");
            strSql.Append("ProductID,ProductNo,ProductName,ProductNameEn,ProductType,SupplierID,Spec1,Spec2,Spec3,Unit,UnitPrice,UnitPriceOut,DepotUp,DepotDown,Color,Size,Remark,Point,ProductProp,CreateDate,CreateUser,Photo,CurQty,UsefulLifeType,BaseProductPlace)");
            strSql.Append(" values (");
            strSql.Append("@ProductID,@ProductNo,@ProductName,@ProductNameEn,@ProductType,@SupplierID,@Spec1,@Spec2,@Spec3,@Unit,@UnitPrice,@UnitPriceOut,@DepotUp,@DepotDown,@Color,@Size,@Remark,@Point,@ProductProp,@CreateDate,@CreateUser,@Photo,@CurQty,@UsefulLifeType,@BaseProductPlace)");
            SqlParameter[] parameters = {
					new SqlParameter("@ProductID", SqlDbType.VarChar,20),
					new SqlParameter("@ProductNo", SqlDbType.VarChar,100),
					new SqlParameter("@ProductName", SqlDbType.VarChar,100),
					new SqlParameter("@ProductNameEn", SqlDbType.VarChar,100),
					new SqlParameter("@ProductType", SqlDbType.VarChar,6),
					new SqlParameter("@SupplierID", SqlDbType.VarChar,6),
					new SqlParameter("@Spec1", SqlDbType.VarChar,100),
					new SqlParameter("@Spec2", SqlDbType.VarChar,100),
					new SqlParameter("@Spec3", SqlDbType.VarChar,100),
					new SqlParameter("@Unit", SqlDbType.VarChar,6),
					new SqlParameter("@UnitPrice", SqlDbType.Decimal,9),
					new SqlParameter("@UnitPriceOut", SqlDbType.Decimal,9),
					new SqlParameter("@DepotUp", SqlDbType.Decimal,9),
					new SqlParameter("@DepotDown", SqlDbType.Decimal,9),
					new SqlParameter("@Color", SqlDbType.VarChar,50),
					new SqlParameter("@Size", SqlDbType.VarChar,100),
					new SqlParameter("@Remark", SqlDbType.VarChar,200),
					new SqlParameter("@Point", SqlDbType.Decimal,9),
					new SqlParameter("@ProductProp", SqlDbType.VarChar,50),
					new SqlParameter("@CreateDate", SqlDbType.DateTime),
					new SqlParameter("@CreateUser", SqlDbType.VarChar,50),
					new SqlParameter("@Photo", SqlDbType.VarChar,50),
					new SqlParameter("@CurQty", SqlDbType.Decimal,9),
					new SqlParameter("@UsefulLifeType", SqlDbType.VarChar,50),
					new SqlParameter("@BaseProductPlace", SqlDbType.VarChar,100)};
            parameters[0].Value = ProductID;
            parameters[1].Value = ProductNo;
            parameters[2].Value = ProductName;
            parameters[3].Value = ProductNameEn;
            parameters[4].Value = ProductType;
            parameters[5].Value = SupplierID;
            parameters[6].Value = Spec1;
            parameters[7].Value = Spec2;
            parameters[8].Value = Spec3;
            parameters[9].Value = Unit;
            parameters[10].Value = UnitPrice;
            parameters[11].Value = UnitPriceOut;
            parameters[12].Value = DepotUp;
            parameters[13].Value = DepotDown;
            parameters[14].Value = Color;
            parameters[15].Value = Size;
            parameters[16].Value = Remark;
            parameters[17].Value = Point;
            parameters[18].Value = ProductProp;
            parameters[19].Value = CreateDate;
            parameters[20].Value = CreateUser;
            parameters[21].Value = Photo;
            parameters[22].Value = CurQty;
            parameters[23].Value = UsefulLifeType;
            parameters[24].Value = BaseProductPlace;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update [T_Product] set ");
            strSql.Append("ProductNo=@ProductNo,");
            strSql.Append("ProductName=@ProductName,");
            strSql.Append("ProductNameEn=@ProductNameEn,");
            strSql.Append("ProductType=@ProductType,");
            strSql.Append("SupplierID=@SupplierID,");
            strSql.Append("Spec1=@Spec1,");
            strSql.Append("Spec2=@Spec2,");
            strSql.Append("Spec3=@Spec3,");
            strSql.Append("Unit=@Unit,");
            strSql.Append("UnitPrice=@UnitPrice,");
            strSql.Append("UnitPriceOut=@UnitPriceOut,");
            strSql.Append("DepotUp=@DepotUp,");
            strSql.Append("DepotDown=@DepotDown,");
            strSql.Append("Color=@Color,");
            strSql.Append("Size=@Size,");
            strSql.Append("Remark=@Remark,");
            strSql.Append("Point=@Point,");
            strSql.Append("ProductProp=@ProductProp,");
            strSql.Append("CreateDate=@CreateDate,");
            strSql.Append("CreateUser=@CreateUser,");
            strSql.Append("Photo=@Photo,");
            strSql.Append("CurQty=@CurQty,");
            strSql.Append("UsefulLifeType=@UsefulLifeType,");
            strSql.Append("BaseProductPlace=@BaseProductPlace");
            strSql.Append(" where ProductID=@ProductID ");
            SqlParameter[] parameters = {
					new SqlParameter("@ProductNo", SqlDbType.VarChar,100),
					new SqlParameter("@ProductName", SqlDbType.VarChar,100),
					new SqlParameter("@ProductNameEn", SqlDbType.VarChar,100),
					new SqlParameter("@ProductType", SqlDbType.VarChar,6),
					new SqlParameter("@SupplierID", SqlDbType.VarChar,6),
					new SqlParameter("@Spec1", SqlDbType.VarChar,100),
					new SqlParameter("@Spec2", SqlDbType.VarChar,100),
					new SqlParameter("@Spec3", SqlDbType.VarChar,100),
					new SqlParameter("@Unit", SqlDbType.VarChar,6),
					new SqlParameter("@UnitPrice", SqlDbType.Decimal,9),
					new SqlParameter("@UnitPriceOut", SqlDbType.Decimal,9),
					new SqlParameter("@DepotUp", SqlDbType.Decimal,9),
					new SqlParameter("@DepotDown", SqlDbType.Decimal,9),
					new SqlParameter("@Color", SqlDbType.VarChar,50),
					new SqlParameter("@Size", SqlDbType.VarChar,100),
					new SqlParameter("@Remark", SqlDbType.VarChar,200),
					new SqlParameter("@Point", SqlDbType.Decimal,9),
					new SqlParameter("@ProductProp", SqlDbType.VarChar,50),
					new SqlParameter("@CreateDate", SqlDbType.DateTime),
					new SqlParameter("@CreateUser", SqlDbType.VarChar,50),
					new SqlParameter("@Photo", SqlDbType.VarChar,50),
					new SqlParameter("@CurQty", SqlDbType.Decimal,9),
					new SqlParameter("@UsefulLifeType", SqlDbType.VarChar,50),
					new SqlParameter("@BaseProductPlace", SqlDbType.VarChar,100),
					new SqlParameter("@ProductID", SqlDbType.VarChar,20)};
            parameters[0].Value = ProductNo;
            parameters[1].Value = ProductName;
            parameters[2].Value = ProductNameEn;
            parameters[3].Value = ProductType;
            parameters[4].Value = SupplierID;
            parameters[5].Value = Spec1;
            parameters[6].Value = Spec2;
            parameters[7].Value = Spec3;
            parameters[8].Value = Unit;
            parameters[9].Value = UnitPrice;
            parameters[10].Value = UnitPriceOut;
            parameters[11].Value = DepotUp;
            parameters[12].Value = DepotDown;
            parameters[13].Value = Color;
            parameters[14].Value = Size;
            parameters[15].Value = Remark;
            parameters[16].Value = Point;
            parameters[17].Value = ProductProp;
            parameters[18].Value = CreateDate;
            parameters[19].Value = CreateUser;
            parameters[20].Value = Photo;
            parameters[21].Value = CurQty;
            parameters[22].Value = UsefulLifeType;
            parameters[23].Value = BaseProductPlace;
            parameters[24].Value = ProductID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(string ProductID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from [T_Product] ");
            strSql.Append(" where ProductID=@ProductID ");
            SqlParameter[] parameters = {
					new SqlParameter("@ProductID", SqlDbType.VarChar,-1)};
            parameters[0].Value = ProductID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


        ///// <summary>
        ///// 得到一个对象实体
        ///// </summary>
        //public void GetModel(string ProductID)
        //{
        //    StringBuilder strSql = new StringBuilder();
        //    strSql.Append("select ProductID,ProductNo,ProductName,ProductNameEn,ProductType,SupplierID,Spec1,Spec2,Spec3,Unit,UnitPrice,UnitPriceOut,DepotUp,DepotDown,Color,Size,Remark,Point,ProductProp,CreateDate,CreateUser,Photo,CurQty,UsefulLifeType,BaseProductPlace ");
        //    strSql.Append(" FROM [T_Product] ");
        //    strSql.Append(" where ProductID=@ProductID ");
        //    SqlParameter[] parameters = {
        //            new SqlParameter("@ProductID", SqlDbType.VarChar,-1)};
        //    parameters[0].Value = ProductID;

        //    DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
        //    if (ds.Tables[0].Rows.Count > 0)
        //    {
        //        if (ds.Tables[0].Rows[0]["ProductID"] != null)
        //        {
        //            this.ProductID = ds.Tables[0].Rows[0]["ProductID"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["ProductNo"] != null)
        //        {
        //            this.ProductNo = ds.Tables[0].Rows[0]["ProductNo"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["ProductName"] != null)
        //        {
        //            this.ProductName = ds.Tables[0].Rows[0]["ProductName"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["ProductNameEn"] != null)
        //        {
        //            this.ProductNameEn = ds.Tables[0].Rows[0]["ProductNameEn"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["ProductType"] != null)
        //        {
        //            this.ProductType = ds.Tables[0].Rows[0]["ProductType"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["SupplierID"] != null)
        //        {
        //            this.SupplierID = ds.Tables[0].Rows[0]["SupplierID"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["Spec1"] != null)
        //        {
        //            this.Spec1 = ds.Tables[0].Rows[0]["Spec1"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["Spec2"] != null)
        //        {
        //            this.Spec2 = ds.Tables[0].Rows[0]["Spec2"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["Spec3"] != null)
        //        {
        //            this.Spec3 = ds.Tables[0].Rows[0]["Spec3"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["Unit"] != null)
        //        {
        //            this.Unit = ds.Tables[0].Rows[0]["Unit"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["UnitPrice"] != null && ds.Tables[0].Rows[0]["UnitPrice"].ToString() != "")
        //        {
        //            this.UnitPrice = decimal.Parse(ds.Tables[0].Rows[0]["UnitPrice"].ToString());
        //        }
        //        if (ds.Tables[0].Rows[0]["UnitPriceOut"] != null && ds.Tables[0].Rows[0]["UnitPriceOut"].ToString() != "")
        //        {
        //            this.UnitPriceOut = decimal.Parse(ds.Tables[0].Rows[0]["UnitPriceOut"].ToString());
        //        }
        //        if (ds.Tables[0].Rows[0]["DepotUp"] != null && ds.Tables[0].Rows[0]["DepotUp"].ToString() != "")
        //        {
        //            this.DepotUp = decimal.Parse(ds.Tables[0].Rows[0]["DepotUp"].ToString());
        //        }
        //        if (ds.Tables[0].Rows[0]["DepotDown"] != null && ds.Tables[0].Rows[0]["DepotDown"].ToString() != "")
        //        {
        //            this.DepotDown = decimal.Parse(ds.Tables[0].Rows[0]["DepotDown"].ToString());
        //        }
        //        if (ds.Tables[0].Rows[0]["Color"] != null)
        //        {
        //            this.Color = ds.Tables[0].Rows[0]["Color"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["Size"] != null)
        //        {
        //            this.Size = ds.Tables[0].Rows[0]["Size"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["Remark"] != null)
        //        {
        //            this.Remark = ds.Tables[0].Rows[0]["Remark"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["Point"] != null && ds.Tables[0].Rows[0]["Point"].ToString() != "")
        //        {
        //            this.Point = decimal.Parse(ds.Tables[0].Rows[0]["Point"].ToString());
        //        }
        //        if (ds.Tables[0].Rows[0]["ProductProp"] != null)
        //        {
        //            this.ProductProp = ds.Tables[0].Rows[0]["ProductProp"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["CreateDate"] != null && ds.Tables[0].Rows[0]["CreateDate"].ToString() != "")
        //        {
        //            this.CreateDate = DateTime.Parse(ds.Tables[0].Rows[0]["CreateDate"].ToString());
        //        }
        //        if (ds.Tables[0].Rows[0]["CreateUser"] != null)
        //        {
        //            this.CreateUser = ds.Tables[0].Rows[0]["CreateUser"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["Photo"] != null)
        //        {
        //            this.Photo = ds.Tables[0].Rows[0]["Photo"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["CurQty"] != null && ds.Tables[0].Rows[0]["CurQty"].ToString() != "")
        //        {
        //            this.CurQty = decimal.Parse(ds.Tables[0].Rows[0]["CurQty"].ToString());
        //        }
        //        if (ds.Tables[0].Rows[0]["UsefulLifeType"] != null)
        //        {
        //            this.UsefulLifeType = ds.Tables[0].Rows[0]["UsefulLifeType"].ToString();
        //        }
        //        if (ds.Tables[0].Rows[0]["BaseProductPlace"] != null)
        //        {
        //            this.BaseProductPlace = ds.Tables[0].Rows[0]["BaseProductPlace"].ToString();
        //        }
        //    }
        //}

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select * ");
            strSql.Append(" FROM [T_Product] ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperSQL.Query(strSql.ToString());
        }

        #endregion  Method
    }
}

